package com.example.cd5160866.urlapp;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;
import android.widget.EditText;

import com.example.cd5160866.urlapp.modelv1.ModelRecyclerView;


public class Demo3Activity extends AppCompatActivity {
    WebView myWebView;


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.list_vertical:
                break;
            case R.id.list_horizontal:
                break;
            case R.id.gridview:
                break;
            case R.id.add:
                break;
            case R.id.delete:
                break;
        }
        return true;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.demo_3);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        myWebView = (WebView) findViewById(R.id.web);

        // 设置页面支持JavaScript
        myWebView.getSettings().setJavaScriptEnabled(true);

        //缩放开关
        //设置此属性，仅支持双击缩放，不支持触摸缩放（android4.0）
        myWebView.getSettings().setSupportZoom(true);
        // 设置是否可缩放
        myWebView.getSettings().setBuiltInZoomControls(true);
        //将图片调整到适合WebView的大小
//        myWebView.getSettings().setUseWideViewPort(true);
        myWebView.getSettings().setDomStorageEnabled(true);

        myWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
        //设置图片自动加载
        myWebView.getSettings().setLoadsImagesAutomatically(true);


        myWebView.loadUrl("https://www.yongche.com/cms/page/fuzhou_all.html?source=20016&city=fz");
    }


}
